From: Carlos Garnacho Date: Fri, 22 Dec 2017 11:30:11 +0000 (+0100) Subject: viewSelector: Send first printable keystroke to the search entry X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~994^2^2~72 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e4ee944d8d64c0692f9d3b8910bc154697aff1ea;p=gnome-shell.git viewSelector: Send first printable keystroke to the search entry StIMText used to handle key events for IM consumption in the capture phase, this made the search box work automagically with nothing explicitly focusing it. Since it's no longer the case, it has to be done somewhere. --- diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 7131f77bd..d9a13a3aa 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -606,6 +606,15 @@ var ViewSelector = new Lang.Class({ // - cancel the search this.reset(); } + } else if (!this._text.has_key_focus() && + (event.type() == Clutter.EventType.KEY_PRESS || + event.type() == Clutter.EventType.KEY_RELEASE)) { + let unichar = event.get_key_unicode(); + + if (GLib.unichar_isprint(unichar)) { + this._text.grab_key_focus(); + return this._text.event(event, false); + } } return Clutter.EVENT_PROPAGATE;